{extend name="public/base" /}

{block name="pjax_container"}
<?php
    $titleTypeName = '预览排名';
?>
<style>
 
.content-header>.breadcrumb>li{
    color: #999;
}
.content-header>.breadcrumb>.active{
    color: #666;
}
.content-header{
    height: 51px;
 
}
.btn-primary{
      background-color: #1890FF;
    color: #fff;
    border: none;
    border-radius: 6px !important;
    margin-left: 15px;
    padding: 5px 10px;
    line-height: 24px; 
}
.box-primary{
  border-top-color: #ecf0f5 !important;
  border-top-width: 16px;
  
}
.btn-primary:hover{
     background-color: #1890FF;
    color: #fff;
    border: none;
    opacity: .9;
    border-radius: 6px !important; 
}
.delete-one{
    background-color: ff4141 !important;
    margin-left: 15px;
    border-radius: 6px;
}
.sreachs{
       background-color: #1890FF;
    color: #fff;
    border: none;
    border-radius: 6px !important;
    margin-left: 15px;
    padding: 7px 15px; 
}
tr>th,td{
 text-align: center;
}
.timepicker{
    border: none;
    margin: 0 10px;
    line-height: 35px;
    text-align: center;
    border: 1px solid #ccc;

}
</style>
<section class="content-header">
    <ol class="breadcrumb">
        <li>统计排名</li>
        <li class="active">预览排名</li>
    </ol>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">

                <div class="box-tools" style="margin:5px;">
                    <form id="form1" action="{:search_url(['type', 'range_time', 'child_show'])}" method="GET" pjax-search="">
                        <div class="input-group input-group-sm">
                            <div>
                                <select name="type" class="select2" style="width:150px;">
                                    <option value="1" {if condition="input('type') == 1"}selected{/if}>奖分排名</option>
                                    <option value="2" {if condition="input('type') == 2"}selected{/if}>扣分排名</option>
                                    <option value="3" {if condition="input('type') == 3"}selected{/if}>事件数排名</option>
                                    <option value="4" {if condition="input('type') == 4"}selected{/if}>奖扣人次排名</option>
                                    <option value="5" {if condition="input('type') == 5"}selected{/if}>奖扣分合计排名</option>
                                    <option value="6" {if condition="input('type') == 6"}selected{/if}>奖扣比例排名</option>
                                </select>
                                <input class="timepicker" name="range_time" value="{$range_time}" placeholder="" AUTOCOMPLETE="off">
                                <div class="input-group-btn" style="display: inline-block;">
                                    <button type="submit" class="btn btn-default sreachs">
                                        <i class="fa fa-search"></i> 查询
                                    </button>
                                </div>
                                <label style="margin-left: 120px;">
                                    <input type="checkbox" name="child_show" value="1" {if condition="input('child_show') == 1"}checked{/if}/><span>显示子级部门人员</span>
                                </label>
                            </div>
                        </div>
                    </form>
                </div>

                <div class="box-header with-border">
                    <div class="pull-left">
                        <a href="javascript:xls_explode();" class="btn btn-sm btn-primary"><i class="fa fa-cloud-upload"></i> 导出</a>
                    </div>
                </div>
                <div class="box-body table-responsive">
                    <table class="table table-bordered table-hover">
                        <tr>
                            <th>排名</th>
                            <th>姓名</th>
                            <th>工号</th>
                            <th>部门</th>
                            <th>{$column_name}</th>
                            <th>B分权限</th>
                        </tr>
                        {volist name="$user_list" id="v"}
                        <tr>
                            <td>
                            {if condition="$v.level==1"}
                            <img style="width: 25px;" src="__STATIC__/web/the_first.png" alt="">
                            {elseif condition="$v.level==2"}
                            <img style="width: 25px;" src="__STATIC__/web/the_secend.png" alt="">
                            {elseif condition="$v.level==3"}
                            <img style="width: 25px;" src="__STATIC__/web/the_third.png" alt="">
                            {else}
                            {$v.level}
                            {/if}
                            </td>
                            <td>{$v["name"]}</td>
                            <td>{$v["job_number"]}</td>
                            <td>{$department_list[$v["department_id"]]['name']}</td>
                            <td>{$v["integral"]}</td>
                            <td>{$v['integral_b']}</td>
                        </tr>
                        {/volist}
                    </table>
                </div>
                <div class="box-footer clearfix">

                </div>
            </div>
        </div>
    </div>
</section>
<script>
    $(function(){

        $(".select2").select2({language:"zh-CN"});

        /*$('.timepicker').datetimepicker({
            format: "{$timepickerFormat | default='YYYY-MM'}",   //YYYY-MM-DD HH:mm:ss
            locale: moment.locale('zh-cn')
        });*/
    });

    layui.use('laydate', function(){
        var laydate = layui.laydate;
        var nowtime = "{:date('Y-01-01 H:i:s',time())}";
        laydate.render({
            type:'month',
            // min: nowtime,
            range:true,
            elem: '.timepicker'
        });
    });

    function xls_explode() {
        window.location.href = "{:url('Reportset/manage_report_ranking')}?" + $('#form1').serialize()+"&export=1&id={:input('id')}&child_show={:input('child_show')}";
        return false;
    }
</script>
{/block}
